#include <iostream>

using namespace std;

class Account {
private:
    int id;         //身份证
    double balance; //账户余额
    double annualInterestRate;//表示当年利率

public:
    Account(int i,double b,double a){
        id = i;
        balance = b;
        annualInterestRate = a;
    }

//    表示返回月利率(月利常为年利率/12)；
    double getMonthlyInterestRate() {
        return  annualInterestRate / 12;
    };

//表示从账户中支取指定金额
    void withDraw(double n) {
        balance -= n;
    }

//表示向账户中存入指定金额；
    void deposit(double m) {
balance +=m;
    }

    //余额
    void disp(){
        cout<<"余额为："<<balance<<endl;
    }
};

int main(){
    Account p1(1122,20000,4.5);
    p1.withDraw(2500);
    p1.disp();
    double a = p1.getMonthlyInterestRate();
    cout<<"月利率"<<a<<endl;
    p1.deposit(3000);
    p1.disp();
    double b = p1.getMonthlyInterestRate();
    cout<<"月利率"<<b<<endl;



}

